from tortoise import BaseDBAsyncClient

RUN_IN_TRANSACTION = True


async def upgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `rag_db` DROP INDEX `db_name`;
        ALTER TABLE `rag_db` DROP COLUMN `db_name`;"""


async def downgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `rag_db` ADD `db_name` VARCHAR(128) NOT NULL UNIQUE COMMENT '文本数据库名';"""


MODELS_STATE = (
    "eJztlWtr2zAUhv9K8KcWumE71+5bGnalSyDNRqEpRrFlR0SWXEneEkr++3Rkp3KcSzPY6A"
    "r7Euz3vEc654l19OikPMJUvh2jJIhmzrvGo8NQivVDLXLRcFCWWR0EhWbUWIX1zKQSKFRa"
    "jRGVWEsRlqEgmSKcaZXllILIQ20kLLFSzshDjgPFE6zmWOjA3b2WCYvwEsvNa7YIYoJptF"
    "UqiWBvowdqlRntM1MfjBF2mwUhp3nKrDlbqTlnT27CFKgJZlgghWF5JXIoH6or+9x0VFRq"
    "LUWJlZwIxyinqtLuiQxCzoCfrkaaBhPY5Y3vtbqtXrPT6mmLqeRJ6a6L9mzvRaIhMJw4ax"
    "NHChUOg9Fyg//NPO/QG8yR2I+vmlODqEuvQ9wg+wsUnWnebnneNL/0wniad9pdV/82O1jr"
    "+LIJUbco/3nOKVoGFLNEzfWr5/eOUP3eHw8+9cdn2nUOq3P9uRenYFiG/CIG6C3qau07tC"
    "d4eeBjraX9GeAbwRK3Z/U55J0mwO7FsXsa2iMkJ+9vJ7BIKuUDrQI8+9q/NWzTVRm5Hg0/"
    "buwV4IPr0ZXmDHMhXlS+cBBmKFz8RCIKdiLc54e8u6HUT+sKYigx1KBj6K+clH0sSDjfN0"
    "PLyNEZiqzn/wx9RTP0BxZy76E+PEIrKS98oE+nuDUh/Xb7hAmpXQcnpIltT0g4Gr8BsbS/"
    "ToCe655yxbju4SsGYtsA9Y4KF2dwG+KXm9FwP8RKSg3kN6YbvItIqC4alEh1/29iPUIRuj"
    "5+vdRvEqDApUqEWcUs8OLXy/oXvsWyUg=="
)
